# MPW Makefile fragment for Mac Xconq.
# Copyright (C) 1993, 1994, 1995 Stanley T. Shebs.

# Xconq is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.  See the file COPYING.

# Compiler to use for compiling.

CC_MPW_C = C -d MPW_C -d MAC -d MPW -mc68020 -model far -b -w -r -d dangerousPattern

CC_SC = SC -d ALMOST_STDC -d MAC -d MPW -mc68020 -model far -b -i '' -i :

CC_MWC68K = MWC68K -d MAC -d MPW -i "{MWCIncludes}" -model far

CC_PPCC = PPCC -d powerc=1 -d pascal= -w -d MAC -d MPW

CC_MRC = MrC -d powerc=1 -d pascal= -i '' -i : -jm -d MAC -d MPW

CC_SMrC = SMrC -d MAC -d MPW

CC_MWCPPC = MWCPPC -enum int -opt global,peep,l4,speed -d MAC -d MPW

CC_68K_GCC = gC -Dpascal= -DANSI_PROTOTYPES -DMAC -DMPW

CC_PPC_GCC = gC -Dpowerc=1 -Dpascal= -DANSI_PROTOTYPES -DMAC -DMPW

# Nothing for the default CFLAGS.

CFLAGS =

# Compiler and/or linker to use for linking.

CC_LD_LINK = Link -w -d -model far

CC_LD_MWLINK68K = MWLink68K -w -d -model far

CC_LD_PPCLINK = PPCLink -main __start -outputformat xcoff

CC_LD_MWLINKPPC = MWLinkPPC -w

CC_LD_GLD = gC

# Extension for linker output.

PROG_EXT_68K =

PROG_EXT_XCOFF = .xcoff

# Nothing for the default LDFLAGS.

LDFLAGS = -w

CC_LD_TOOL_FLAGS = -c 'MPS ' -t MPST

LinkOptions	=	

EXTRALIBS_C = \Option-d
	"{CLibraries}"CSANELib.o \Option-d
	"{CLibraries}"Math.o \Option-d
	"{CLibraries}"StdClib.o \Option-d
	"{Libraries}"Runtime.o \Option-d
	"{Libraries}"Interface.o

EXTRALIBS_MWC68K = \Option-d
	"{MW68KLibraries}MacOS.lib" \Option-d
	"{MW68KLibraries}ANSI (4i) C.68K.Lib" \Option-d
	"{MW68KLibraries}MathLib68K (4i).Lib"

EXTRALIBS_MWCPPC = \Option-d
	"{MWPPCLibraries}"InterfaceLib \Option-d
	"{MWPPCLibraries}"MWStdCRuntime.Lib \Option-d
	"{MWPPCLibraries}"StdCLib \Option-d
	"{MWPPCLibraries}"PPCToolLibs.o

# Tool to make PEF with, if needed.

MAKEPEF_NULL = null-command

MAKEPEF_PPC = MakePEF

MAKEPEF_FLAGS = \Option-d
	-l InterfaceLib.xcoff=InterfaceLib \Option-d
	-l MathLib.xcoff=MathLib \Option-d
	-l StdCLib.xcoff=StdCLib

MAKEPEF_TOOL_FLAGS = -ft MPST -fc 'MPS '

# Resource compiler to use.

REZ_68K = Rez

REZ_PPC = Rez -d WANT_CFRG

krn = :kernel:

mac = :mac:

crs = :curses:

libcrs = :libcurses:

doc = :doc:

obj = :Objects:

"{obj}" \Option-f "{krn}" "{mac}" "{crs}" "{doc}"

.c.o \Option-f .c
   {CC} {DepDir}{Default}.c {CFLAGS} {INCLUDES} -s {Default} -o {TargDir}{Default}.c.o

INCLUDES =  -i "{krn}" -i "{mac}" -i "{crs}" -i "{libcrs}"

MACOBJS = \Option-d
		"{obj}"macconq.c.o \Option-d
		"{obj}"macdesign.c.o \Option-d
		"{obj}"macdraw.c.o \Option-d
		"{obj}"machelp.c.o \Option-d
		"{obj}"macimf.c.o \Option-d
		"{obj}"macinit.c.o \Option-d
		"{obj}"maclist.c.o \Option-d
		"{obj}"macmap.c.o \Option-d
		"{obj}"macmap2.c.o \Option-d
		"{obj}"macmenus.c.o \Option-d
		"{obj}"maccmd.c.o \Option-d
		"{obj}"macwins.c.o

CURSESOBJS = \Option-d
		"{obj}"cconq.c.o \Option-d
		"{obj}"ccmd.c.o \Option-d
		"{obj}"cdraw.c.o \Option-d
		"{obj}"cmdline.c.o \Option-d
		"{obj}"curses.c.o \Option-d
		"{obj}"v_maccur.c.o

SKELOBJS = \Option-d
		"{obj}"skelconq.c.o \Option-d
		"{obj}"cmdline.c.o \Option-d
		"{obj}"compile.c.o \Option-d

OBJECTS = \Option-d
		"{obj}"actions.c.o \Option-d
		"{obj}"ai.c.o \Option-d
		"{obj}"combat.c.o \Option-d
		"{obj}"copying.c.o \Option-d
		"{obj}"generic.c.o \Option-d
		"{obj}"ui.c.o \Option-d
		"{obj}"help.c.o \Option-d
		"{obj}"history.c.o \Option-d
		"{obj}"imf.c.o \Option-d
		"{obj}"init.c.o \Option-d
		"{obj}"lisp.c.o \Option-d
		"{obj}"mknames.c.o \Option-d
		"{obj}"mkrivers.c.o \Option-d
		"{obj}"mkroads.c.o \Option-d
		"{obj}"mkterr.c.o \Option-d
		"{obj}"mkunits.c.o \Option-d
		"{obj}"module.c.o \Option-d
		"{obj}"mplayer.c.o \Option-d
		"{obj}"nlang.c.o \Option-d
		"{obj}"plan.c.o \Option-d
		"{obj}"ps.c.o \Option-d
		"{obj}"read.c.o \Option-d
		"{obj}"run.c.o \Option-d
		"{obj}"score.c.o \Option-d
		"{obj}"side.c.o \Option-d
		"{obj}"tables.c.o \Option-d
		"{obj}"task.c.o \Option-d
		"{obj}"types.c.o \Option-d
		"{obj}"unit.c.o \Option-d
		"{obj}"util.c.o \Option-d
		"{obj}"world.c.o \Option-d
		"{obj}"write.c.o \Option-d
		"{obj}"mac.c.o

IMFAPPOBJS = \Option-d
		"{obj}"imfapp.c.o \Option-d
		"{obj}"macimf.c.o \Option-d
		"{obj}"imf.c.o \Option-d
		"{obj}"lisp.c.o \Option-d
		"{obj}"util.c.o

IMF2IMFOBJS = \Option-d
		"{obj}"imf2imf.c.o \Option-d
		"{obj}"imf.c.o \Option-d
		"{obj}"lisp.c.o \Option-d
		"{obj}"util.c.o

# The application itself.

XCONQ_NAME = Xconq

{XCONQ_NAME} \Option-f {MACOBJS} {OBJECTS}
	{CC_LD} -o {XCONQ_NAME} -t APPL -c XCNQ {MACOBJS} {OBJECTS} {EXTRALIBS}		
	{REZ}  -o {XCONQ_NAME} -rd -append -s : :mac:XconqMPW.r

# The curses application.

CCONQ_NAME = Cconq

{CCONQ_NAME} \Option-f {CURSESOBJS} {OBJECTS}
	{CC_LD} -o {CCONQ_NAME} -t APPL -c CCNQ {CURSESOBJS} {OBJECTS} {EXTRALIBS}		
	{REZ}  -o {CCONQ_NAME} -rd -append -s : :mac:CconqMPW.r

# The test skeleton (an MPW tool).

Skelconq \Option-f {SKELOBJS} {OBJECTS}
	{CC_LD} -o Skelconq {CC_LD_TOOL_FLAGS} {SKELOBJS} {OBJECTS} {EXTRALIBS}

# The image family manipulation app.

IMFAPP_NAME = IMFApp

{IMFAPP_NAME} \Option-f {IMFAPPOBJS}
	{CC_LD} -o {IMFAPP_NAME} -t APPL -c imfA {IMFAPPOBJS} {EXTRALIBS}		
	{REZ}  -o {IMFAPP_NAME} -rd -append -s : :mac:IMFAppMPW.r

# Image family tool.

imf2imf \Option-f {IMF2IMFOBJS}
	{CC_LD} -o imf2imf {CC_LD_TOOL_FLAGS} {IMF2IMFOBJS} {EXTRALIBS}

# This is a little tool used to make permuted indexes of GDL symbols.

kwic \Option-f "{obj}"kwic.c.o
	{CC_LD} -o kwic {CC_LD_TOOL_FLAGS} "{obj}"kwic.c.o {EXTRALIBS}

clean \Option-f
	Delete -y "{obj}"\Option-x.c.o

LISP_H = "{krn}"lisp.h "{krn}"keyword.def

GAME_H = "{krn}"game.h "{krn}"utype.def "{krn}"mtype.def "{krn}"ttype.def "{krn}"gvar.def "{krn}"table.def

UNIT_H = "{krn}"unit.h "{krn}"action.def "{krn}"plan.def "{krn}"task.def "{krn}"goal.def

HISTORY_H = "{krn}"history.h "{krn}"history.def

CONQ_H = "{krn}"conq.h "{krn}"config.h "{krn}"misc.h "{krn}"dir.h {LISP_H} "{krn}"module.h {GAME_H} \Option-d
	"{krn}"player.h "{krn}"side.h {UNIT_H} "{krn}"world.h {HISTORY_H} "{krn}"score.h "{krn}"help.h \Option-d
	"{krn}"ai.h "{krn}"system.h

MAC_H = "{mac}"macconq.h "{mac}"macdefs.h "{mac}"macimf.h

"{obj}"macconq.c.o \Option-f "{mac}"macconq.c {CONQ_H} {MAC_H}
"{obj}"macdesign.c.o \Option-f "{mac}"macdesign.c {CONQ_H} {MAC_H}
"{obj}"macdraw.c.o \Option-f "{mac}"macdraw.c {CONQ_H} {MAC_H}
"{obj}"machelp.c.o \Option-f "{mac}"maclist.c {CONQ_H} {MAC_H}
"{obj}"macimf.c.o \Option-f "{mac}"macimf.c {CONQ_H} {MAC_H}
"{obj}"macinit.c.o \Option-f "{mac}"macinit.c {CONQ_H} {MAC_H}
"{obj}"maclist.c.o \Option-f "{mac}"maclist.c {CONQ_H} {MAC_H}
"{obj}"macmap.c.o \Option-f "{mac}"macmap.c {CONQ_H} {MAC_H}
"{obj}"macmenus.c.o \Option-f "{mac}"macmenus.c {CONQ_H} {MAC_H}
"{obj}"maccmd.c.o \Option-f "{mac}"maccmd.c {CONQ_H} {MAC_H}
"{obj}"macwins.c.o \Option-f "{mac}"macwins.c {CONQ_H} {MAC_H}

"{obj}"imfapp.c.o \Option-f "{mac}"imfapp.c {LISP_H} "{krn}"imf.h "{mac}"macimf.h

"{obj}"cconq.c.o \Option-f "{crs}"cconq.c {CONQ_H} "{crs}"cconq.h
"{obj}"ccmd.c.o \Option-f "{crs}"ccmd.c {CONQ_H} "{crs}"cconq.h
"{obj}"cdraw.c.o \Option-f "{crs}"cdraw.c {CONQ_H} "{crs}"cconq.h
"{obj}"curses.c.o \Option-f "{libcrs}"curses.c
"{obj}"v_maccur.c.o \Option-f "{libcrs}"v_maccur.c

"{obj}"skelconq.c.o \Option-f "{krn}"skelconq.c {CONQ_H}
"{obj}"cmdline.c.o \Option-f "{krn}"cmdline.c {CONQ_H}
"{obj}"compile.c.o \Option-f "{krn}"compile.c {CONQ_H}

"{obj}"imf2imf.c.o \Option-f "{krn}"imf2imf.c {CONQ_H}

"{obj}"actions.c.o \Option-f "{krn}"actions.c {CONQ_H}
"{obj}"ai.c.o \Option-f "{krn}"ai.c {CONQ_H}
"{obj}"combat.c.o \Option-f "{krn}"combat.c {CONQ_H}
"{obj}"generic.c.o \Option-f "{krn}"generic.c {CONQ_H}
"{obj}"ui.c.o \Option-f "{krn}"ui.c {CONQ_H}
"{obj}"help.c.o \Option-f "{krn}"help.c {CONQ_H}
"{obj}"history.c.o \Option-f "{krn}"history.c {CONQ_H}
"{obj}"imf.c.o \Option-f "{krn}"imf.c {CONQ_H}
"{obj}"init.c.o \Option-f "{krn}"init.c {CONQ_H} "{krn}"version.h
"{obj}"lisp.c.o \Option-f "{krn}"lisp.c {CONQ_H}
"{obj}"mknames.c.o \Option-f "{krn}"mknames.c {CONQ_H}
"{obj}"mkrivers.c.o \Option-f "{krn}"mkrivers.c {CONQ_H}
"{obj}"mkroads.c.o \Option-f "{krn}"mkroads.c {CONQ_H}
"{obj}"mkterr.c.o \Option-f "{krn}"mkterr.c {CONQ_H}
"{obj}"module.c.o \Option-f "{krn}"module.c {CONQ_H}
"{obj}"mplayer.c.o \Option-f "{krn}"mplayer.c {CONQ_H}
"{obj}"nlang.c.o \Option-f "{krn}"nlang.c {CONQ_H}
"{obj}"plan.c.o \Option-f "{krn}"plan.c {CONQ_H}
"{obj}"ps.c.o \Option-f "{krn}"ps.c {CONQ_H}
"{obj}"read.c.o \Option-f "{krn}"read.c {CONQ_H}
"{obj}"run.c.o \Option-f "{krn}"run.c {CONQ_H}
"{obj}"score.c.o \Option-f "{krn}"score.c {CONQ_H}
"{obj}"side.c.o \Option-f "{krn}"side.c {CONQ_H}
"{obj}"tables.c.o \Option-f "{krn}"tables.c {CONQ_H}
"{obj}"task.c.o \Option-f "{krn}"task.c {CONQ_H}
"{obj}"types.c.o \Option-f "{krn}"types.c {CONQ_H}
"{obj}"unit.c.o \Option-f "{krn}"unit.c {CONQ_H}
"{obj}"util.c.o \Option-f "{krn}"util.c {CONQ_H}
"{obj}"world.c.o \Option-f "{krn}"world.c {CONQ_H}
"{obj}"write.c.o \Option-f "{krn}"write.c {CONQ_H}

"{obj}"mac.c.o \Option-f "{krn}"mac.c {CONQ_H}

"{obj}"kwic.c.o \Option-f "{doc}"kwic.c

